/*   1:    */ package com.rinsi.app.zjxx;
/*   2:    */ 
/*   3:    */ import com.rinsi.core.CoreCache;
/*   4:    */ import com.rinsi.core.service.CoreSimpleService;
/*   5:    */ import com.rinsi.util.AssertUtil;
/*   6:    */ import com.rinsi.util.MapUtil;
/*   7:    */ import java.util.HashMap;
/*   8:    */ import java.util.List;
/*   9:    */ import java.util.Map;
/*  10:    */ import org.mybatis.spring.SqlSessionTemplate;
/*  11:    */ import org.springframework.stereotype.Service;
/*  12:    */ 
/*  13:    */ @Service
/*  14:    */ public class ZjxxService
/*  15:    */   extends CoreSimpleService
/*  16:    */ {
/*  17:    */   public void afterIndex(Map<String, Object> model, Map<String, Object> rMap)
/*  18:    */   {
/*  19: 21 */     Map<String, Object> params = getParams(model);
/*  20:    */     
/*  21: 23 */     rMap.put("xkzs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(210002)));
/*  22:    */     
/*  23: 25 */     rMap.put("scxkzs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(210001)));
/*  24:    */     
/*  25: 27 */     rMap.put("jjlxs", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(400002)));
/*  26:    */     
/*  27: 29 */     rMap.put("kcfss", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(3)));
/*  28:    */     
/*  29: 31 */     rMap.put("organs", CoreCache.getCacheList(MapUtil.getString(params, "UID"), "organs", "ORGAN_TYPE=9"));
/*  30:    */     
/*  31: 33 */     rMap.put("xxzts", getSqlSessionTemplate().selectList("Core.getCodeList", Integer.valueOf(210003)));
/*  32:    */   }
/*  33:    */   
/*  34:    */   public void beforeList(Map<String, Object> model)
/*  35:    */   {
/*  36: 40 */     Map<String, Object> params = getParams(model);
/*  37:    */     
/*  38: 42 */     Map<String, Object> config = getConfig(model);
/*  39:    */     
/*  40: 44 */     Map<String, Object> organ = CoreCache.getCacheMap(
/*  41:    */     
/*  42: 46 */       MapUtil.getString(params, "UID"), "organ");
/*  43:    */     
/*  44: 48 */     Map<String, Object> paramsOrgan = new HashMap();
/*  45:    */     
/*  46: 50 */     paramsOrgan.putAll(params);
/*  47:    */     
/*  48: 52 */     paramsOrgan.remove("ORGAN_ID");
/*  49:    */     
/*  50: 54 */     paramsOrgan.remove("AQSC_ZT");
/*  51:    */     
/*  52: 56 */     paramsOrgan.remove("KZZ_ZT");
/*  53:    */     
/*  54: 58 */     paramsOrgan.putAll(organ);
/*  55: 60 */     if (MapUtil.getInteger(organ, "ORGAN_TYPE").intValue() == 9)
/*  56:    */     {
/*  57: 62 */       paramsOrgan.remove("SJZT");
/*  58:    */       
/*  59: 64 */       List<Map<String, Object>> datas = getSqlSessionTemplate().selectList(namespace(config) + ".list", paramsOrgan);
/*  60: 66 */       if (!AssertUtil.isCollectionNotEmpty(datas)) {
/*  61: 68 */         getSqlSessionTemplate().insert(
/*  62: 69 */           namespace(config) + ".insert", paramsOrgan);
/*  63:    */       }
/*  64:    */     }
/*  65:    */   }
/*  66:    */   
/*  67:    */   public Map<String, Object> save(Map<String, Object> model)
/*  68:    */   {
/*  69: 77 */     Map<String, Object> params = getParams(model);
/*  70:    */     
/*  71: 79 */     Map<String, Object> config = getConfig(model);
/*  72:    */     
/*  73: 81 */     Map<String, Object> rMap = getRMap();
/*  74:    */     try
/*  75:    */     {
/*  76: 85 */       String type = MapUtil.getString(params, "ZJLX_TYPE");
/*  77:    */       
/*  78: 87 */       getSqlSessionTemplate().update(namespace(config) + ".update" + type, params);
/*  79:    */       
/*  80: 89 */       rMap.put("data", getSqlSessionTemplate().selectOne(namespace(config) + ".get", params));
/*  81:    */     }
/*  82:    */     catch (Exception ex)
/*  83:    */     {
/*  84: 93 */       rMap.put("success", Boolean.valueOf(false));
/*  85: 95 */       if (MapUtil.getBoolean(rMap, "shoeExMessage").booleanValue()) {
/*  86: 97 */         rMap.put("message", ex.getMessage());
/*  87:    */       } else {
/*  88:101 */         rMap.put("message", "保存数据出错！请稍后重试，或联系系统管理员！");
/*  89:    */       }
/*  90:104 */       rMap.put("ex", ex.getMessage());
/*  91:    */       
/*  92:106 */       ex.printStackTrace();
/*  93:    */     }
/*  94:109 */     return rMap;
/*  95:    */   }
/*  96:    */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.app.zjxx.ZjxxService
 * JD-Core Version:    0.7.0.1
 */